<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page import="sohsite.fachada.SistemaSohSite"%>
<%@page import="sohsite.usuario.Usuario"%>
<%@page import="java.util.Collection"%>
<html>

	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<title>SohSite</title>
		<link rel="stylesheet" type="text/css" href="sohsite.css"/>
	</head>

	<body>
<%
		String login = (String)session.getValue("loginUsuario");
		SistemaSohSite sistema = SistemaSohSite.getInstancia();
		Usuario usuario = sistema.getControladorUsuario().consultarUsuarioPorLogin(login);
		if (usuario == null){
			response.sendRedirect("../login.jsp");
			return;
		}
		
		int idUsuarioLogado = usuario.getId();

		boolean isAdmin = false;
		if(login.equals("admin"))
			isAdmin = true;
%>
<%		if (isAdmin){
%>			<%@ include file="cabecalhoAdmin.inc" %>
<%		}else{
%>			<%@ include file="cabecalhoUser.inc" %>
<%		}
%>
		<div id="leftSection">&nbsp;</div>
		<div id="midsection">
        	<h2 align=center>Alterar Senha</h2>
			<form action="../ServletAtualizarSenha" method="POST" id="formSenha">
			<input type="hidden" name="idUsuario" value="<%=idUsuarioLogado %>">
  				<fieldset>
 					<br>
					<label>Login:</label>
        			<input  disabled type="text" nome="login" size=30 value="<%=usuario.getLogin() %>" maxlength="30"/>
                    <br>
                    <br>
					<label>Senha Antiga:</label>
        			<input name="oldPass" type="password" size=30 maxlength="15" />
                    <br>
					<label>Nova Senha:</label>
        			<input name="newPass1" type="password" size=30 maxlength="15" />
                    <br>
					<label>Confirme nova Senha:</label>
        			<input name="newPass2" type="password" size=30 maxlength="15" />
                    <br>
				    <input  alt="" type="submit" value="Salvar" class="botao"  />
  				</fieldset>    
			</form>
		</div>
		<div id="rightSection">&nbsp;</div>
		<div id="footer"></div>

	</body>

</html>
